A database system generates redo logs. These redo logs, for example, may record operations belonging to a stream of transactions performed by the database system. Information mined from redo logs can be utilized in a variety of ways. For instance, such information can be utilized for replication, auditing, asynchronous event deliveries, asynchronous change data capture, and database restoration.
Typically, the sharing of mined information from redo logs may be accomplished by using a publisher-subscriber model. In such a model, one or more publisher processes are deployed at one or more source entities (for example, local database systems that are part of the overall distributed database system) to mine the redo logs at the source entities, while one or more subscriber processes are deployed at a target entity (for example, a remote database system that is also a part of the same overall distributed database system) to consume in parallel the results from the publishers. More often than not, in between the publishers and the subscribers, intermediate processes (such as propagation processes) may be used to transfer the results from the publishers to the subscribers. More specifically, under this model, results from mining may be placed in a first staging area at the source entities by the publisher processes. The mining results may be read from the first staging area at the source entities, and transferred to a second staging area at the target entity, by the propagation processes. Finally, the mining results in the second staging area may be accessed, and applied at the target entity, by the apply processes.
Generally speaking, multiple processes may concurrently access the same staging area (such as the second staging area at the target entity) for the purpose of reading and writing into the area. Accordingly, a latch mechanism is typically used for the purpose of coordinating concurrent accesses to such a staging area to prevent incompatible memory accesses by various processes. Since the staging area is a shared resource (which, for example, may be implemented in the form of a shared memory segment) between the multiple processes, interference among the processes may occur. For example, a particular record in the mining results may be locked by a process. As a result, memory space occupied by the particular record may not be available for other uses (such as storing new mining results) or for other processes. Furthermore, all other records that are in the same transaction as the particular record may also have to be resident in the shared memory, since the transaction is not fully applied at the target entity. This problem is exacerbated if there are many long transactions being shared between source and target entities. Memory pressure problems (such as memory spills where demands for memory space exceed the capacity of available primary memory space and data intended to be stored in the primary memory space may thus have to be spilled over to secondary memory space like disk storage) may frequently occur.
Therefore, a better mechanism, which would better support distributed information sharing through log mining, is needed.